import QtQml
        import QtQuick
        import QtQuick.Window
        import QtQuick.Controls 2.15
        import QtQuick.Layouts
        import QtQuick.Controls.Material


        ApplicationWindow {

        property bool isMoveWindow: false
        property point rootWindowTitleMousePos: Qt.point(x,y)
        id: rootWindow
        width: 800
        height: 400
        visible: true
        title:qsTr("QML demo")
        //设置标题栏隐藏
        flags: Qt.Window | Qt.FramelessWindowHint
        //onTitleChanged: rootWindowTitleBarTitleText.text = title
        onWidthChanged: {
        tableView.forceLayout()
        }

        MyTitleBar{
        id: title


        }

        MyMenuBar{
        id:menu
        anchors.top: title.bottom
        }


        GridLayout {
        anchors.top: menu.bottom
        id: grid
        columns: 2
        rows: 3

        ColumnLayout {
        spacing: 2
        Layout.preferredWidth: 400

        Text {
        id: leftlabel
        Layout.alignment: Qt.AlignHCenter
        color: "white"
        font.pointSize: 16
        text: "Qt for Python"
        Layout.preferredHeight: 100
        Material.accent: Material.Green
        }

        TextField{
        id:tf
        objectName: "tf"
        text:"sssss"
        }

        Button {
        id: btn
        text:qsTr("begin")
        onClicked: {
        tf.text = con.getContext()
        }
        }

        RadioButton {
        id: italic
        text: "Italic"
        onToggled: {

        leftlabel.font.italic = con.getItalic(italic.text)
        leftlabel.font.bold = con.getBold(italic.text)
        leftlabel.font.underline = con.getUnderline(italic.text)

        }
        }
        RadioButton {
        id: bold
        text: "Bold"
        onToggled: {
        leftlabel.font.italic = con.getItalic(bold.text)
        leftlabel.font.bold = con.getBold(bold.text)
        leftlabel.font.underline = con.getUnderline(bold.text)
        }
        }
        RadioButton {
        id: underline
        text: "Underline"
        onToggled: {
        leftlabel.font.italic = con.getItalic(underline.text)
        leftlabel.font.bold = con.getBold(underline.text)
        leftlabel.font.underline = con.getUnderline(underline.text)
        }
        }
        RadioButton {
        id: noneradio
        text: "None"
        checked: true
        onToggled: {
        leftlabel.font.italic = con.getItalic(noneradio.text)
        leftlabel.font.bold = con.getBold(noneradio.text)
        leftlabel.font.underline = con.getUnderline(noneradio.text)
        }
        }
        }

        ColumnLayout {
        id: rightcolumn
        spacing: 2
        Layout.columnSpan: 1
        Layout.preferredWidth: 400
        Layout.preferredHeight: 400
        Layout.fillWidth: true

        RowLayout {
        Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
        Button {
        id: red
        text: "Red"
        highlighted: true
        Material.accent: Material.Red
        onClicked: {
        leftlabel.color = con.getColor(red.text)
        }
        }
        Button {
        id: green
        text: "Green"
        highlighted: true
        Material.accent: Material.Green
        onClicked: {
        leftlabel.color = con.getColor(green.text)
        }
        }
        Button {
        id: blue
        text: "Blue"
        highlighted: true
        Material.accent: Material.Blue
        onClicked: {
        leftlabel.color = con.getColor(blue.text)

        }
        }
        MyButton {
        id: nonebutton
        text: "None"
        highlighted: true
        Material.accent: Material.BlueGrey
        onClicked: {
        leftlabel.color = con.getColor(nonebutton.text)
        dialog.show();
        dialog.requestActivate();
        }
        }

        MyDialog{
        id: dialog
        width: 500
        height: 400
        visible: false
        }

        }
        RowLayout {
        id:rl_slider
        Layout.fillWidth: true
        Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
        Text {
        id: rightlabel
        color: "white"
        text: "Font size"
        Material.accent: Material.White
        }
        Slider {
        width: rightcolumn.width*0.6
        Layout.alignment: Qt.AlignRight
        id: slider
        value: 0.5
        onValueChanged: {
        leftlabel.font.pointSize = con.getSize(value)
        }
        }
        }
        MyTableView2{
        id:tableView
        width: 400
        height:600
        }

        }


        }
        }

